#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <stdio.h>

#define SOCK_PATH "/tmp/mysocket"

int main() {
	    int fd;
	        struct sockaddr_un addr;
		    char buf[100];

		        fd = socket(AF_UNIX, SOCK_STREAM, 0);
			    memset(&addr, 0, sizeof(addr));
			        addr.sun_family = AF_UNIX;
				    strcpy(addr.sun_path, SOCK_PATH);
				        
				        connect(fd, (struct sockaddr*)&addr, sizeof(addr));
					    read(fd, buf, sizeof(buf));
					        printf("Client received: %s\n", buf);
						    
						    write(fd, "Client Reply", 12);
						        close(fd);
							    return 0;
}
